package patrol.mobile.com.mobilepatrol.utils;

import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.assist.LoadedFrom;
import com.nostra13.universalimageloader.core.display.BitmapDisplayer;
import com.nostra13.universalimageloader.core.imageaware.ImageAware;


/**
 * 图片圆角处理
 * @author Jacen
 * @email jacen@wscnydx.com
 * @datetime 2014年5月24日 下午2:31:30
 */
public class RoundBitmapDisplayer implements BitmapDisplayer {

	private int type;
	private int roundPx;

	/**
     *
     *
     *
     */
	public RoundBitmapDisplayer(int type, int roundPx) {
		this.type = type;
		this.roundPx = roundPx;
	}

	@Override
	public void display(Bitmap bitmap, ImageAware imageAware,
                        LoadedFrom loadedFrom) {
		try {
			imageAware.setImageBitmap(BitmapFillet.fillet(type, bitmap, roundPx));
		} catch (Exception e) {
			e.printStackTrace();
		}catch (Error e) {
			e.printStackTrace();
		}
	}

}
